/**
 * Copyright(c) by JNet Smartware Group.
 * All rights reserved. Not distribution or redistribution without
 * any permission of JNet Smartware Group.
 * 
 * @author thuc
 * 2010/03/15
 */
package vn.smartware.co.server.sql.factory;

import java.sql.Connection;

import vn.smartware.co.framework.bean.MenuDTO;
import vn.smartware.co.framework.bean.AddressDTO;
import vn.smartware.co.framework.bean.UserDTO;
import vn.smartware.co.framework.bean.ProgramDTO;
import vn.smartware.co.framework.bean.LoginDTO;
import vn.smartware.co.framework.exception.ServerException;
import vn.smartware.co.framework.form.BaseForm;

/**
 * @author thuctt
 *
 */
public interface AbstractInitializeSQLManager {

	/**
	 * get menu
	 * @param user 
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void getMenuSQL(LoginDTO user, Connection conn) throws ServerException;

	/**
	 * get program list
	 * 
	 * @param menu
	 * @param dto 
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void getPrgListSQL(MenuDTO menu, LoginDTO dto, Connection conn)
			throws ServerException;

	/**
	 * getProgramsSQL
	 * @param form
	 * @param user
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void getProgramsSQL(BaseForm form,
			LoginDTO user, Connection conn) throws ServerException;

	/**
	 * register program
	 * @param prg
	 * @param user
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void registerProgramSQL(ProgramDTO prg, LoginDTO user,
			Connection conn) throws ServerException;

	/**
	 * get only menu list without authority
	 * @param user
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void getMenuListWithoutAuthSQL(LoginDTO user, Connection conn)
			throws ServerException;

	/**
	 * create new menu
	 * @param dto
	 * @param user 
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void createNewMenuSQL(MenuDTO dto, LoginDTO user, Connection conn)
			throws ServerException;

	/**
	 * update menu
	 * @param dto
	 * @param user 
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void updateMenuSQL(MenuDTO dto, LoginDTO user, Connection conn)
			throws ServerException;

	/**
	 * delete menu
	 * @param dto
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void deleteMenuSQL(MenuDTO dto, Connection conn)
			throws ServerException;

	/**
	 * create menu authority
	 * @param dto
	 * @param user
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void createMenuAuthoritySQL(MenuDTO dto, LoginDTO user,
			Connection conn) throws ServerException;

	/**
	 * get max menu ID
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void getMaxMenuIdSQL(Connection conn)
			throws ServerException;

	/**
	 * getComboInitItemsSQL
	 * @param key
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void getComboInitItemsSQL(String key, Connection conn) throws ServerException;

	/**
	 * Clear all rows in table ACTIONLOG
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void clearLogSQL(Connection conn) throws ServerException;

	/**
	 * delete authority
	 * @param dto
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void deleteAuthSQL(MenuDTO dto, Connection conn)
			throws ServerException;

	/**
	 * getUsersSQL
	 * @param form
	 * @param user
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void getUsersSQL(BaseForm form, LoginDTO user, Connection conn)
			throws ServerException;

	/**
	 * deleteUserSQL
	 * @param dto
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void deleteUserSQL(UserDTO dto, Connection conn)
			throws ServerException;

	/**
	 * deleteAuthOfUserSQL
	 * @param dto
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void deleteAuthOfUserSQL(UserDTO dto, Connection conn)
			throws ServerException;

	/**
	 * register login info
	 * @param dto
	 * @param user
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void registerLoginInfoSQL(UserDTO dto, LoginDTO user,
			Connection conn) throws ServerException;
	
	/**
	 * update login info
	 * @param dto
	 * @param user
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void updateLoginInfoSQL(UserDTO dto, LoginDTO user,
			Connection conn) throws ServerException;

	/**
	 * insert address
	 * @param addr
	 * @param user
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void insertAddressSQL(AddressDTO addr, LoginDTO user,
			Connection conn) throws ServerException;

	/**
	 * update address
	 * @param addr
	 * @param user
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void updateAddressSQL(AddressDTO addr, LoginDTO user,
			Connection conn) throws ServerException;

	/**
	 * get max addressCd
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void getMaxAddressCdSQL(Connection conn)
			throws ServerException;

	/**
	 * get max userID
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void getMaxUserIDSQL(Connection conn)
			throws ServerException;

	/**
	 * get program list of current login user
	 * @param userId
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void getAuthProgramsSQL(String userId, Connection conn)
			throws ServerException;

	/**
	 * deleteAllPrgsOfUserSQL
	 * @param form
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void deleteAllPrgsOfUserSQL(BaseForm form, Connection conn) throws ServerException;

	/**
	 * registerAuthSQL
	 * @param prg
	 * @param userID
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void registerAuthSQL(ProgramDTO prg, String userID,
			Connection conn) throws ServerException;

	/**
	 * getAvailableMenuSQL
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void getAvailableMenuSQL(Connection conn)
			throws ServerException;

	/**
	 * deleteAddressSQL
	 * @param addr
	 * @param conn
	 * @throws ServerException
	 */
	abstract public void deleteAddressSQL(AddressDTO addr, Connection conn)
			throws ServerException;

}
